import { request } from '@/utils/axios';
import { indexApi } from '@/api/allUrl'

/**
 * @description: 登录
*/
export function loginApi(params: object) {
    return request.post(
        indexApi.login,
        params
    );
}
/**
 * @description: 获取户型列表
*/
export function getHouseListApi(params: object) {
    return request.post(
        indexApi.getHouseListUrl,
        params
    );
}
/**
 * @description: 获取户型列表
*/
export function getHouseInfoApi(params: { id?: number }) {
    return request.get(
        indexApi.getHouseInfoUrl + `?id=${params.id}`,
    );
}
/**
 * @description: 下载户型文件
*/
export function downFileApi(params: { houseId?: number | string, houseFileId?: number | string }) {
    return request.get(
        indexApi.downFileUrl + `?houseId=${params.houseId}&houseFileId=${params.houseFileId}`,
    );
}

/**
 * @description: 保存户型价格
*/
export function saveHousePriceApi(params: any) {
    return request.post(
        indexApi.savePriceUrl,
        params
    );
}

/**
 * @description: 通过户型审核
*/
export function passHouseApi(params: { id?: number }) {
    return request.get(
        indexApi.passHouseUrl + `?id=${params.id}`,
    );
}

/**
 * @description: 拒绝户型审核
*/
export function adoptApi(params: any) {
    return request.post(
        indexApi.adoptUrl,
        params
    );
}


/**
 * @description: 下架户型审核
*/
export function lowerHouseApi(params: any) {
    return request.post(
        indexApi.lowerHouseUrl,
        params
    );
}
/**
 * @description: 获取用户列表
*/
export function getUserListApi(params: object) {
    return request.post(
        indexApi.getUserListUrl,
        params
    );
}
/**
 * @description: 禁用用户
*/
export function disableUserApi(params: any) {
    return request.post(
        indexApi.disableUserUrl,
        params
    );
}
/**
 * @description: 删除用户
*/
export function delUserApi(params: { id?: number }) {
    return request.get(
        indexApi.delUserUrl + `?id=${params.id}`,
    );
}

/**
 * @description: 查看用户详情
*/
export function seeUserInfoApi(params: { id?: number }) {
    return request.get(
        indexApi.seeUserInfoUrl + `?id=${params.id}`,
    );
}

/**
 * @description: 获取充值列表
*/
export function getRechargeListApi(params: object) {
    return request.post(
        indexApi.getRechargeUrl,
        params
    );
}

/**
 * @description: 获取客服列表
*/
export function getCustomerListApi(params: object) {
    return request.post(
        indexApi.getCustomerListUrl,
        params
    );
}
/**
 * @description: 创建/修改套餐
*/
export function saveRechargeApi(params: object) {
    return request.post(
        indexApi.saveRechargeUrl,
        params
    );
}
/**
 * @description: 创建/修改客服信息
*/
export function saveCustomerApi(params: object) {
    return request.post(
        indexApi.saveCustomerUrl,
        params
    );
}
/**
 * @description: 停用启用套餐
*/
export function operationRechargeApi(params: { id?: number }) {
    return request.get(
        indexApi.operationRechargeUrl + `?id=${params.id}`,
    );
}
/**
 * @description: 停用启用客服
*/
export function enableOrDisableApi(params: { id?: number }) {
    return request.get(
        indexApi.enableOrDisableUrl + `?id=${params.id}`,
    );
}
/**
 * @description: 删除套餐
*/
export function delRechargeApi(params: { id?: number }) {
    return request.get(
        indexApi.delRechargeUrl + `?id=${params.id}`,
    );
}
/**
 * @description: 删除客服
*/
export function delCustomerApi(params: { id?: number }) {
    return request.get(
        indexApi.delCustomerUrl + `?id=${params.id}`,
    );
}

/**
 * @description: 获取设计助手列表
*/
export function getDesignListApi(params: object) {
    return request.post(
        indexApi.getDesignListUrl,
        params
    );
}
/**
 * @description: 删除设计助手
*/
export function delDesignApi(params: { id?: number }) {
    return request.get(
        indexApi.delDesignUrl + `?id=${params.id}`,
    );
}


/**
 * @description: 停用启用设计助手
*/
export function openOrStopDesignApi(params: { id?: number }) {
    return request.get(
        indexApi.openOrStopDesignUrl + `?id=${params.id}`,
    );
}
/**
 * @description: 创建/修改设计助手
*/
export function saveDesignApi(params: object) {
    return request.post(
        indexApi.saveDesignUrl,
        params
    );
}

/**
 * @description: 获取轮播图列表
*/
export function getSwiperListApi(params: object) {
    return request.post(
        indexApi.getSwiperListUrl,
        params
    );
}
/**
 * @description: 创建/修改轮播图
*/
export function saveSwiperApi(params: object) {
    return request.post(
        indexApi.saveSwiperUrl,
        params
    );
}
/**
 * @description: 获取轮播图详情
*/
export function getSwiperInfoApi(params: { id?: number }) {
    return request.get(
        indexApi.getSwiperInfoUrl + `?id=${params.id}`,
    );
}

/**
 * @description: 获取客服类型
*/
export function getCustomerTypeApi() {
    return request.get(
        indexApi.getCustomerTypeUrl,
    );
}

/**
 * @description: 删除轮播图
*/
export function delSwiperApi(params: { id?: number }) {
    return request.get(
        indexApi.delSwiperUrl + `?id=${params.id}`,
    );
}
/**
 * @description: 上传图片
*/
export function updateFileApi(params: any) {
    return request.postUpdate(
        indexApi.updateFileUrl,
        params,
    );
}

/**
 * @description: 添加设计助手案例
*/
export function addDesignAnLiApi(params: object) {
    return request.post(
        indexApi.addDesignAnLiUrl,
        params
    );
}